package com.zhuojy.equity.mall.admin.web.controller.car;

import com.zhuojy.equity.mall.admin.common.entity.po.car.TCarFuelcardPO;
import com.zhuojy.equity.mall.admin.common.pojo.ResultEntity;
import com.zhuojy.equity.mall.admin.service.car.TCarFuelcardServcie;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author xrz
 * @version 1.0
 * @description:TODO
 * @date 2024/4/1 15:52
 */
@RestController
@RequiredArgsConstructor
@CrossOrigin
@RequestMapping("carfuelcard")
public class TCarFuelcardController {
    @Autowired
    private TCarFuelcardServcie tCarFuelcardServcie;

    /**
     * 查询油卡
     * @param tCarFuelcardPO
     * @param pageSize
     * @param pageNum
     * @return
     */
    @RequestMapping("findTCarFuelcard")
    private ResultEntity findTCarFuelcard(@RequestBody TCarFuelcardPO tCarFuelcardPO, @RequestParam("pageSize") Integer pageSize, @RequestParam("pageNum") Integer pageNum) {
        return tCarFuelcardServcie.findTCarFuelcard(tCarFuelcardPO, pageSize, pageNum);
    }

    /**
     * 添加油卡
     * @param tCarFuelcardPO
     * @return
     */
    @RequestMapping("addTCarFuelcard")
    private ResultEntity addTCarFuelcard(@RequestBody TCarFuelcardPO tCarFuelcardPO) {

        return tCarFuelcardServcie.addTCarFuelcard(tCarFuelcardPO);
    }

    /**
     * 通过id查询油卡信息
     * @param id
     * @return
     */
    @RequestMapping("findTCarFuelcardByid")
    private ResultEntity findTCarFuelcardByid(@RequestParam("id") Integer id){
        return tCarFuelcardServcie.findTCarFuelcardByid(id);
    }

    /**
     * 修改信息
     * @param tCarFuelcardPO
     * @return
     */
    @RequestMapping("upTCarFuelcard")
    private ResultEntity upTCarFuelcard(@RequestBody TCarFuelcardPO tCarFuelcardPO){
        return tCarFuelcardServcie.upTCarFuelcard(tCarFuelcardPO);
    }

    /**
     * 删除信息
     * @param id
     * @return
     */
    @RequestMapping("delTCarFuelcard")
    private ResultEntity delTCarFuelcard(@RequestParam("id") Integer id){
        return tCarFuelcardServcie.delTCarFuelcard(id);
    }
}
